package com.atguigu.gmall.task.t0;

import com.atguigu.gmall.mq.config.MqConst;
import com.atguigu.gmall.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author ：MJS
 * @date ：Created in 2021/5/31  10:06
 * @description：TODO
 * 将DB
 * 中的数据导入缓存中
 */
@Component
public class Task0 {
    @Autowired
    private RabbitService rabbitService;
    @Scheduled(cron = "0/20 * * * * ?")//调度任务
    public void task0(){
/*        *//**
         * 定时任务
         *//*
        public static final String EXCHANGE_DIRECT_TASK = "exchange.direct.task";
        public static final String ROUTING_TASK_1 = "seckill.task.1";
        //队列
        public static final String QUEUE_TASK_1  = "queue.task.1";
        */
        //队列
        //闹铃 唤醒
        rabbitService.sendMessage(MqConst.EXCHANGE_DIRECT_TASK,
                MqConst.ROUTING_TASK_1,
                "");
        System.out.println("执行task0");
    }

}
